Project Specification

The following describes all the available fields of a Project:

  1. apiVersion: argoproj.io/v1alpha1
  2. kind: AppProject
  3. metadata:
  4. name: my-project
  5. namespace: argocd
  6. # Finalizer that ensures that project is not deleted until it is not referenced by any application
  7. finalizers:
  8. - resources-finalizer.argocd.argoproj.io
  9. spec:
  10. # Project description
  11. description: Example Project
  12. # Allow manifests to deploy from any Git repos
  13. sourceRepos:
  14. - '*'
  15. # Only permit applications to deploy to the guestbook namespace in the same cluster
  16. # Destination clusters can be identified by 'server', 'name', or both.
  17. destinations:
  18. - namespace: guestbook
  19. server: https://kubernetes.default.svc
  20. name: in-cluster
  21. # Deny all cluster-scoped resources from being created, except for Namespace
  22. clusterResourceWhitelist:
  23. - group: ''
  24. kind: Namespace
  25. # Allow all namespaced-scoped resources to be created, except for ResourceQuota, LimitRange, NetworkPolicy
  26. namespaceResourceBlacklist:
  27. - group: ''
  28. kind: ResourceQuota
  29. - group: ''
  30. kind: LimitRange
  31. - group: ''
  32. kind: NetworkPolicy
  33. # Deny all namespaced-scoped resources from being created, except for Deployment and StatefulSet
  34. namespaceResourceWhitelist:
  35. - group: 'apps'
  36. kind: Deployment
  37. - group: 'apps'
  38. kind: StatefulSet
  39. # Enables namespace orphaned resource monitoring.
  40. orphanedResources:
  41. warn: false
  42. roles:
  43. # A role which provides read-only access to all applications in the project
  44. - name: read-only
  45. description: Read-only privileges to my-project
  46. policies:
  47. - p, proj:my-project:read-only, applications, get, my-project/*, allow
  48. groups:
  49. - my-oidc-group
  50. # A role which provides sync privileges to only the guestbook-dev application, e.g. to provide
  51. # sync privileges to a CI system
  52. - name: ci-role
  53. description: Sync privileges for guestbook-dev
  54. policies:
  55. - p, proj:my-project:ci-role, applications, sync, my-project/guestbook-dev, allow
  56. # NOTE: JWT tokens can only be generated by the API server and the token is not persisted
  57. # anywhere by Argo CD. It can be prematurely revoked by removing the entry from this list.
  58. jwtTokens:
  59. - iat: 1535390316
  60. # Sync windows restrict when Applications may be synced. https://argo-cd.readthedocs.io/en/stable/user-guide/sync_windows/
  61. syncWindows:
  62. - kind: allow
  63. schedule: '10 1 * * *'
  64. duration: 1h
  65. applications:
  66. - '*-prod'
  67. manualSync: true
  68. - kind: deny
  69. schedule: '0 22 * * *'
  70. duration: 1h
  71. namespaces:
  72. - default
  73. - kind: allow
  74. schedule: '0 23 * * *'
  75. duration: 1h
  76. clusters:
  77. - in-cluster
  78. - cluster1
  79. # By default, apps may sync to any cluster specified under the `destinations` field, even if they are not
  80. # scoped to this project. Set the following field to `true` to restrict apps in this cluster to only clusters
  81. # scoped to this project.
  82. permitOnlyProjectScopedClusters: false
  83. # When using Applications-in-any-namespace, this field determines which namespaces this AppProject permits
  84. # Applications to reside in. Details: https://argo-cd.readthedocs.io/en/stable/operator-manual/app-any-namespace/
  85. sourceNamespaces:
  86. - "argocd-apps-*"